package test;

import java.awt.Graphics;
import java.awt.Image;

import javax.swing.JPanel;

public class ImagePanel extends JPanel {

	/**
	 * Create the panel.
	 */
	public ImagePanel() {

	}
	
	private Image image;
	public void setImage(Image im) {
		image = im;
		repaint();
	}
	
	@Override
	protected void paintComponent(Graphics g) {
		super.paintComponent(g);
		
		if(image != null) {
			g.drawImage(image, 0, 0, null);
		}
	}
	
	

}
